﻿using System;


namespace Victor_test1
{
    class Program
    {
        static void Main(string[] args)
        {
            int enteredDigit = 0;
            Console.WriteLine("Enter a digit (or X for exit)");
            while (true)
            {
                string enteredDigitString = Console.ReadLine();
                bool tryParseResult = int.TryParse(enteredDigitString, out enteredDigit);

                var a = (decimal)Math.Abs(100);

                if (tryParseResult)
                {
                    if (enteredDigit > 0)
                    {
                        break;
                    }
                }

                if (enteredDigitString == "X" || enteredDigitString == "x")
                {
                    return;
                }

                Console.Beep();
            }

            var ringer = new CapsLockRinger();

            ringer.Ring(enteredDigit);
        }
    }
}
